using UnityEngine;
using System.Collections;

public class LoadStateButton : MonoBehaviour {
	

	void Update(){
		if(THistory.Instance.isUndoing() || !StatesHandler.Instance.hasStates()){
			gameObject.GetComponent<UIButton>().isEnabled = false;
		}else{
			gameObject.GetComponent<UIButton>().isEnabled = true;
		}
	}
	
	void OnClick(){
		THistory.Instance.undoing = true;
		StatesHandler.Instance.Activated = true;
		StatesHandler.Instance.refreshDisplay();
	}	
}
